{% extends "base.html" %}
{% load cms_tags %}
{% load i18n %}

{% block extra_js %}
{{ block.super }}
<script type="text/javascript">
$(document).ready(function(){
	$('select').parent().children('input').each(function(){
			var val = $(this).val();
			var valStr = $(this).siblings().children('option[value='+ val +']').text();
			$(this).parent().parent().children('.value').text( valStr );
		});
	});
</script>
{% endblock %}
	
{% block base_content %}
	<div class="container">
	{% include "component/event/event-breadcrumb-succeed.html" %}
		<div class="row">
			<div class="col-md-12">
				<!-- header -->
				{% if pData == None %}
					<h3 class="text-danger">{% trans "Signup serial number dose not exist." %}</h3>
				{% else %}
					<h3 class="text-success">{% trans "Signup succeed" %}</h3>
					<div class="page-header" ></div>
					<h4 class="text-info">{% trans "Signup infomation" %}</h4>
					<br><small class="text-muted">*{% trans "Use serial number to modify sign-up information before signup is closed." %}</small>
					<table class="table table-striped">
						<thead>
						</thead>
						<tbody>
							<tr>
								<td style="font-weight:bold">{% trans "Serial number" %}</td>
								<td class="text-danger"><strong>{{pData.signupKey}}</strong></td>
								<td></td>
								<td></td>
							</tr>
							<tr>
								<td style="font-weight:bold">{% trans "Name" %}</td>
								<td>{{pData.name}}</td>
								<td style="font-weight:bold">{% trans "Gender" %}</td>
								<td>
									<div class="value"></div>
									<div class="controls" style="display:none">
										<input type="hidden" id="gender_id" name="gender" style="display:none" value={{pData.gender}}>
										<select class="selectpicker" id="gender_select">
											<option selected="selected" value="Male">{% trans "Male" %}</option>
											<option value="Female">{% trans "Female" %}</option>
										</select>
									</div>
								</td>
							</tr>
							<tr>
								<td style="font-weight:bold">{% trans "Personal id" %}</td>
								<td>{{pData.pid}}</td>
								<td style="font-weight:bold">{% trans "Birthday" %}</td>
								<td>{{pData.bday|date:"Y-m-d"}}</td>
							</tr>
							<tr>
								<td style="font-weight:bold">{% trans "Phone Number" %}</td>
								<td>{{ pData.phoneNum }}</td>
								<td style="font-weight:bold">{% trans "Nationality" %}</td>
								<td>
									<div class="value"></div>
									<div class="controls" style="display:none">
										<input type="hidden" id="country_id" name="nationality" style="display:none" value={{pData.nationality}}>
										{% include "component/country-selector.html" %}
									</div>
								</td>
							</tr>
							<tr>
								<td style="font-weight:bold">Email</td>
								<td>{{ pData.email }}</td>
								<td style="font-weight:bold">{% trans "Estimate time" %}</td>
								<td>
									<div class="value"></div>
									<div class="controls" style="display:none">
										<input type="hidden" id="estimateTime_id" name="estimateTime" style="display:none" value={{ pData.estimateTime }}>
										<select class="selectpicker" id="estimateTime_select">
											<option value="unknown" selected="selected">{% trans "unknown" %}</option>
											<option value="below 18:00">{% trans "below" %} 18:00</option>
											<option value="18:00~20:00">18:00~20:00</option>
											<option value="20:00~22:00">20:00~22:00</option>
											<option value="22:00~25:00">22:00~25:00</option>
											<option value="over 25:00">{% trans "over" %} 25:00</option>
										</select>
									</div>
								</td>
							</tr>
							<tr>
								<td style="font-weight:bold">{% trans "Emergency contact person" %}</td>
								<td>{{ pData.emgcyContact }}</td>
								<td style="font-weight:bold">{% trans "Emergency contact person's phone number" %}</td>
								<td>{{ pData.emgcyContPhone }}</td>
							</tr>
						</tbody>
					</table>
				{% endif %}
			</div>
		</div>
	</div>
{% endblock %}